home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6843 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: rex.sfe.com.au!not-for-mail
  2. From: paul@sfe.com.au (Paul Hatchman)
  3. Newsgroups: comp.windows.x.motif,comp.lang.c++
  4. Subject: Re: MOTIF Callbacks, C++ Member Functions - SOLVED
  5. Date: 20 Feb 1996 14:25:57 +1100
  6. Organization: Sydney Futures Exchange, Sydney, Australia
  7. Distribution: inet
  8. Message-ID: <4gbf05$6d8@rex.sfe.com.au>
  9. References: <4f6oau$c4m@knot.queensu.ca> <4f9fbo$7ju@news1.halcyon.com>
  10. NNTP-Posting-Host: rex.sfe.com.au
  11.  
  12. danubius@chinook.halcyon.com () writes:
  13.  
  14. >Wintermute  <3mal5@qlink.queensu.ca> wrote:
  15. >>
  16. >>The solution was to declare a static member function which is used as a 
  17. >>callback.  Since it is static, there is no 'this' pointer, and it works 
  18. >>fine.  To access the particular class instance, pass the 'this' pointer 
  19. >>as client data when installing the callback, and it will be available 
  20. >>when the static member function is called back.
  21.  
  22. >Which is exactly the method Doug Young uses in his book on Motif with
  23. >C++.
  24.  
  25. >Joe
  26.  
  27. I dont think there are any guarantees that a compiler will give static
  28. functions "C" style linkage. It works with every compiler I have tried, but I
  29. dont believe it is guaranteed to be portable.
  30.  
  31. Can someone give an authorative answer on this?
  32.  
  33.     - Paul
  34.  
  35. --------------------------------------------------------------------------------
  36. Paul Hatchman,                        |  <this line intentionally left blank>
  37. Project Leader,                       |      paul@sfe.com.au
  38. Sydney Futures Exchange, Australia    |      Tel: +61 2 2560567
  39. --------------------------------------------------------------------------------
  40.